3.103 \(\int \frac{\sec ^2(c+d x)}{a+i a \tan (c+d x)} \, dx\)

Optimal. Leaf size=23 \[ \frac{x}{a}+\frac{i \log (\cos (c+d x))}{a d} \]

[Out]

x/a + (I*Log[Cos[c + d*x]])/(a*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0408845, antiderivative size = 23, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083, Rules used = {3487, 31} \[ \frac{x}{a}+\frac{i \log (\cos (c+d x))}{a d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^2/(a + I*a*Tan[c + d*x]),x]

[Out]

x/a + (I*Log[Cos[c + d*x]])/(a*d)

Rule 3487

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rubi steps

\begin{align*} \int \frac{\sec ^2(c+d x)}{a+i a \tan (c+d x)} \, dx &=-\frac{i \operatorname{Subst}\left (\int \frac{1}{a+x} \, dx,x,i a \tan (c+d x)\right )}{a d}\\ &=\frac{x}{a}+\frac{i \log (\cos (c+d x))}{a d}\\ \end{align*}

Mathematica [A]  time = 0.0893654, size = 31, normalized size = 1.35 \[ \frac{2 \tan ^{-1}(\tan (d x))+i \log \left (\cos ^2(c+d x)\right )}{2 a d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^2/(a + I*a*Tan[c + d*x]),x]

[Out]

(2*ArcTan[Tan[d*x]] + I*Log[Cos[c + d*x]^2])/(2*a*d)

________________________________________________________________________________________

Maple [A]  time = 0.03, size = 23, normalized size = 1. \begin{align*}{\frac{-i\ln \left ( a+ia\tan \left ( dx+c \right ) \right ) }{ad}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^2/(a+I*a*tan(d*x+c)),x)

[Out]

-I/a/d*ln(a+I*a*tan(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 1.16437, size = 27, normalized size = 1.17 \begin{align*} -\frac{i \, \log \left (i \, a \tan \left (d x + c\right ) + a\right )}{a d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

-I*log(I*a*tan(d*x + c) + a)/(a*d)

________________________________________________________________________________________

Fricas [A]  time = 2.21461, size = 65, normalized size = 2.83 \begin{align*} \frac{2 \, d x + i \, \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{a d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

(2*d*x + I*log(e^(2*I*d*x + 2*I*c) + 1))/(a*d)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**2/(a+I*a*tan(d*x+c)),x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [B]  time = 1.18413, size = 80, normalized size = 3.48 \begin{align*} -\frac{\frac{2 i \, \log \left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - i\right )}{a} - \frac{i \, \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right )}{a} - \frac{i \, \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right )}{a}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

-(2*I*log(tan(1/2*d*x + 1/2*c) - I)/a - I*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a - I*log(abs(tan(1/2*d*x + 1/2*c
) - 1))/a)/d